<template>
	<div class="integral">
		<div class="inner" v-html="content">
			
		</div>
	</div>
</template>

<script>
	import serve from '../../static/request.js';
	import storage from '../../static/appkey.js';
	import common from '../../static/jump.js';
	import {Base64} from '../../static/base64.min.js';
	
	export default {
		data() {
			return {
				type: 'register',
				content:'',
				contentHtml : '',
				version: '',
			}
		},
		methods: {
			getIndex() {
				var self = this;
				serve
					.request({
						url: '/site/agreement',
						data: {
							appkey: uni.getStorageSync('appkey'),
							type: self.type
						}
					})
					.then(res => {
						wx.setNavigationBarTitle({
							title: res.data.title,
						});
						// let Base64 = require('js-base64').Base64;
						// self.content = Base64.decode(res.data.content);
						console.log(Base64)
						self.content = Base64.decode(res.data.content).replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');	
						console.log(self.content)
						// self.contentHtml = res.data.content_html;	
					});
			}
		},
		onLoad(options) {
			const accountInfo = uni.getAccountInfoSync();
			this.version = accountInfo.miniProgram.version;
			this.type = options.type;
			this.getIndex();
		},
		onPullDownRefresh() {
			this.getIndex();
		}
	}
</script>

<style lang="scss" scoped>
.integral {
	padding: 0 27rpx;
	h6 {
		font-size: 28rpx;
		font-weight: bold;
		color: rgba(60, 72, 104, 1);
		margin: 48rpx 0 35rpx;
	}
	.top {
		p {
			font-size: 28rpx;
			font-family: FZLanTingHei-R-GBK;
			font-weight: 400;
			color: rgba(60, 72, 104, 1);
		}
	}
	
	.inner{
		overflow-y:auto;
		overflow-x:hidden;
		width: 98%;
		margin: 0 1%;
		::v-deep {
		    img,p,span {
		       width: 100%;
		    }
		}
	}
	// .inner >>> img,p,span {
	//   width: 100%;
	// }
}
</style>
